package ${package.Service};

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${superServiceImplClassPackage};

import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
* @author zhouhonggang
* @version 1.0.0
* @project rapid-development-platform
* @datetime ${date}
* @description: [${table.comment!}·逻辑]
*/
@Service
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}>{

    /**
     * 根据条件分页查询
     * @param entity 实体对象
     * @return 分页对象
     */
    public Page<${entity}> page(${entity} entity)
    {
        //封装分页参数
        Page<${entity}> page = Page.of(entity.getPageNo(), entity.getPageSize());
        //封装查询参数
        QueryWrapper<${entity}> wrapper = new QueryWrapper<>();
        //假如name有值则执行查询
        //if(StringUtils.hasLength(entity.getName())) {
        //    wrapper.like("name", entity.getName());
        //}
        //执行分页条件查询
        return baseMapper.selectPage(page, wrapper);
    }

}
